<?php
	// Class: DataSource
	// 
	// Interface for all datasource classes used in the project
	//
	// Author: Arttu Valo
	// Date: 2.10.2006
	
	error_reporting(E_ALL);
	
	// Include version information
	require_once("common/version.inc.php");
	
	abstract class DataSource
	{
		// GetVersion
		// Returns version information
		// 
		// Retuns a string containing the version
		function GetVersion()
		{
			return VERSION." b".BETA_VERSION;
		}
		
		// Connect
		// Connects to datasource
		//
		// $serverName - Server name
		// $userName   - User name for the server
		// $password   - Password for the server
		// $dbName     - Optionally giving database name to select on connect
		// 
		// Returns TRUE on success, FALSE on failure
		abstract public function Connect($serverName, $userName, $passWord, $dbName="");
		
		// Close
		// Close the connection to the datasource
		// 
		// Returns TRUE on success, FALSE on failure
		abstract public function Close();
		
		// SelectDB
		// Selects active database
		// 
		// Returns TRUE on success, FALSE on failure
		abstract public function SelectDB($dbName);
		
		// Query
		// Do a query to the database
		// 
		// $sql - The query string
		// 
		// Return value is dependet to the query
		abstract public function Query($sql);
	}
?>